package com.smart.car.member;

import com.netflix.loadbalancer.IRule;
import com.smart.car.member.rule.NacosWeightedRule;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.web.filter.HiddenHttpMethodFilter;
import org.springframework.web.server.ServerWebExchange;
import org.springframework.web.server.WebFilterChain;

/**
* @Description: 消费者启动类
* @author: zoutao
* @date: 2021/4/26 14:37
*/

// 开启远程调用
@EnableFeignClients(basePackages = "com.smart.car.member.feign")
//开启服务注册与发现功能
@EnableDiscoveryClient
@Slf4j
@SpringBootApplication
public class SmartcarMemberApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(SmartcarMemberApplication.class, args);
        ConfigurableEnvironment env = context.getEnvironment();
        String port = env.getProperty("server.port");
        String path = env.getProperty("server.servlet.context-path");
        log.info("\n----------------------------------------------------------\n\t" +
                "Application Boot is running! Access URLs:\n\t" +
                "Local: \t\thttp://localhost:" + port + path +"/\n\t" +
                "Swagger-UI: \t\thttp://localhost:" + port + path + "/doc.html\n" +
                "----------------------------------------------------------");
        log.info("member用户服务已经启动...");
    }
}
